//
// Created by tang on 23-4-1.
//

#include "ui_registry.hpp"

// containers
#include "container/column.hpp"
#include "container/row.hpp"
#include "container/group.hpp"
#include "container/tabview.hpp"

// controls
#include "controls/button.hpp"
#include "controls/checkbox.hpp"
#include "controls/label.hpp"
#include "controls/input.hpp"
#include "controls/image.hpp"
#include "controls/select.hpp"
#include "controls/separator.hpp"
#include "controls/slider.hpp"
#include "controls/spacing.hpp"
#include "controls/toggle.hpp"

const std::unordered_map<std::string, pfn_ui_creator> *get_ui_factories ()
{
    static const std::unordered_map<std::string, pfn_ui_creator> factories = {
        // containers
        {"column", &ui_creator<column>},
        {"group", &ui_creator<group>},
        {"row", &ui_creator<row>},
        {"tabview", &ui_creator<tab_view>},

        // controls
        {"button", &ui_creator<button>},
        {"checkbox", &ui_creator<checkbox>},
        {"image", &ui_creator<image_view>},
        {"label", &ui_creator<label>},
        {"input", &ui_creator<input_item>},
        {"select", &ui_creator<select_item>},
        {"separator", &ui_creator<separator>},
        {"slider", &ui_creator<slider>},
        {"spacing", &ui_creator<spacing>},
        {"toggle", &ui_creator<toggle>},
    };

    return &factories;
}
